package cn.wangsy.zhidao;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class CycleInput {

	public static void main(String[] args) throws IOException {
		int key = 1;
		switch (key) {
		case 1:
			int n = 1,b = 0,num1 = 0;
			Scanner s = new Scanner(System.in);
			FileWriter school = new FileWriter("school.txt", true);
			while (n != 0) {
				System.out.println("请输入学校名称:");
				String schoolname = null;
				schoolname = s.next();
				System.out.println("请输入学校编号:");
				b = s.nextInt();
				school.write(b);
				school.write("\r\n");
				school.write(schoolname);
				school.write("\r\n");
				num1++;
				System.out.println("输入成功！\r\n");
				System.out.println("是否还要继续输入（是:输入1,否:输入0）:");
				n = s.nextInt();
			}
			school.close();
			s.close();
			break;

		default:
			break;
		}

	}

}
